package org.jsola.hr.query;

import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jsola.core.query.BaseQuery;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

import static org.jsola.hr.example.EmpInfoExample.*;
import static org.jsola.hr.example.EmpInfoExample.E_JOIN_DATE_END;

/**
 * 员工信息查询对象
 *
 * @author wcl
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class EmpListQuery extends BaseQuery {

    @ApiParam(value = "员工id集合", required = true)
    private List<String> empIdList;

    @ApiParam(value = "公司id", required = true)
    @NotNull(message = "公司id不能为空")
    private String companyId;

    @ApiParam(value = "岗位类型( 1劳务派遣 2外包 3社保代缴 4薪资代发),\",\"分割")
    private String postType;

    @ApiParam(value = "员工姓名/手机号,支持\",\"分割")
    private String nameOrPhone;

    @ApiParam(value = "员工姓名/身份证号,支持\",\"分割")
    private String nameOrIdCard;

    @ApiParam(value = "正式类型（1:试用期,2:已转正,0:无状态）,多个用','拼接")
    private String formalType;

    @ApiParam(value = "薪资规则id")
    private String salaryRuleId;

    @ApiParam(value = "劳务费规则id")
    private String serviceFeeRuleId;

    @ApiParam(value = "标签")
    private String tag;

    @ApiParam(value = "标签List")
    private List<String> tags;

    @ApiParam
    private String idCard;

    /**
     * 入职时间查询范围
     */
    @ApiParam(value = N_JOIN_DATE_START, example = E_JOIN_DATE_START)
    private Date joinDateStart;
    @ApiParam(value = N_JOIN_DATE_END, example = E_JOIN_DATE_END)
    private Date joinDateEnd;

    /**
     * 每页的条数
     */
    @ApiParam(value = "分页参数，每页的条数", example = "20")
    @Max(value = 1000, message = "pageSize不能大于1000")
    private Integer pageSize = 20;

    /**
     * 当前第几页
     */
    @ApiParam(value = "分页参数，第几页", example = "1")
    @Min(value = 1, message = "pageNo不能小于1")
    private Integer pageNo = 1;
}
